PAGE_PATH=/msun/programs/msun-auth-platform-www/www
CONTAINER_NAME=msun-auth-platform-www
PORT=30540
ZIP_FILE_NAME=dist


deployment:
	unzip -o /tmp/$(ZIP_FILE_NAME).zip -d $(PAGE_PATH)
	mv $(PAGE_PATH)/$(ZIP_FILE_NAME)/* $(PAGE_PATH)
	rm -rf /tmp/$(ZIP_FILE_NAME).zip
	docker run --net=host -d -p $(PORT):$(PORT) --name=$(CONTAINER_NAME) \
 	-v $(PAGE_PATH):/www \
 	-e PORT=$(PORT) \
 	 msun-page-proxy

restart:
	rm -rf $(PAGE_PATH)
	unzip -o /tmp/$(ZIP_FILE_NAME).zip -d $(PAGE_PATH)
	mv $(PAGE_PATH)/$(ZIP_FILE_NAME)/* $(PAGE_PATH)
	rm -rf /tmp/$(ZIP_FILE_NAME).zip
	docker restart $(CONTAINER_NAME)


webEtl:
	rm -rf /usr/local/nginx/html/web-etl
	unzip -o /tmp/web-etl.zip -d /usr/local/nginx/html
	rm -r /tmp/web-etl.zip

nginx:
	docker run --net=host -d -p 80:80 -p 443:443 --name=nginx \
     	-v /msun/app/nginx-docker/ssl/:/ssl/ \
     	-v /msun/app/nginx-docker/html/:/html/ \
     	-v /msun/app/nginx-docker/nginx.conf:/etc/nginx/nginx.conf \
     	 nginx
reload:
	docker restart nginx